<template>
    <BaseContainer>
        <aplid-base-crud ref="crud" class="w-100" v-bind="baseConfig" >
           <template #detailDialog ="{row}">
                <DetailPart :nowRowData = "row" type="self" :needExport="true"></DetailPart>
           </template>
           <template #taskId ="{row}">
                <el-tooltip
                    v-if="row.daysLeftToExpire&&row.taskStatus!='ENDED'"
                    effect="dark"
                    :content="judgeTiop(row.daysLeftToExpire)"
                    placement="bottom"
                >
                <span style="color:red">{{row.taskId}}</span>
                </el-tooltip>
                <span v-else>{{row.taskId}}</span>
           </template>
           <!-- 审批 -->
        </aplid-base-crud>
    </BaseContainer>
  </template>
  
  <script setup lang="ts">
  import { baseConfig} from './config'
  import DetailPart from '../detailPart/index.vue'

  let crud = ref()
  //  处理刷新
  const handleRefresh = (query?: any) => {
      nextTick(() => {
          crud.value.refreshChange(query)
      })
  }
  const judgeTiop = (data) =>{
    if(Number(data)>0){
        return `距离过期剩余${data}天`
    }else if(Number(data)<0){
        return `已过期${Math.abs(data)}天`
    } else if(Number(data) == 0){
        return '今天过期'
    } else{
        return data
    }
  }

  
  </script>
  
  <style scoped lang="scss">

  </style>